(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/goods/detail/children/sh-price" ], {
    "08f2": function(t, e, i) {
        var n = i("2e21");
        i.n(n).a;
    },
    "2e21": function(t, e, i) {},
    "66a7": function(t, e, i) {
        i.r(e);
        var n, a = i("d5fb"), c = i("f56e");
        for (n in c) "default" !== n && function(t) {
            i.d(e, t, function() {
                return c[t];
            });
        }(n);
        i("08f2");
        var o = i("f0c5"), a = Object(o.a)(c.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        e.default = a.exports;
    },
    d5fb: function(t, e, i) {
        i.d(e, "b", function() {
            return n;
        }), i.d(e, "c", function() {
            return a;
        }), i.d(e, "a", function() {});
        var n = function() {
            var t = this, e = (t.$createElement, t._self._c, t.detail.activity && "seckill" === t.detail.activity.type && t.loading ? t.getProgress(t.detail.sales, t.detail.stock) : null);
            t.$mp.data = Object.assign({}, {
                $root: {
                    m0: e
                }
            });
        }, a = [];
    },
    f56e: function(t, e, i) {
        i.r(e);
        var n, a = i("fbca"), c = i.n(a);
        for (n in a) "default" !== n && function(t) {
            i.d(e, t, function() {
                return a[t];
            });
        }(n);
        e.default = c.a;
    },
    fbca: function(t, e, i) {
        Object.defineProperty(e, "__esModule", {
            value: !0
        }), e.default = void 0;
        var n = null, a = {
            name: "shPrice",
            components: {},
            data: function() {
                return {
                    loading: !1,
                    time: {},
                    activityRules: {
                        startTime: 0,
                        endTime: 0,
                        status: "",
                        countDownTime: 0
                    }
                };
            },
            props: {
                detail: Object,
                type: ""
            },
            created: function() {
                this.detail.activity && this.detail.activity.type && this.doActivityRules();
            },
            destroyed: function() {
                clearInterval(n);
            },
            computed: {},
            methods: {
                getProgress: function(t, e) {
                    return 0 < e + t ? (t / (t + e) * 100).toFixed(2) + "%" : "0%";
                },
                doActivityRules: function() {
                    var t = this;
                    switch (t.detail.activity.type) {
                      case "seckill":
                      case "groupon":
                        t.activityRules.startTime = 1e3 * t.detail.activity.starttime, t.activityRules.endTime = 1e3 * t.detail.activity.endtime, 
                        t.countDown(), setTimeout(function() {
                            t.loading = !0;
                        }, 500);
                    }
                },
                countDown: function() {
                    var e = this, i = 0;
                    e.activityRules.endTime < new Date().getTime() && (e.activityRules.status = "end", 
                    e.$emit("change", JSON.stringify(e.activityRules))), n = setInterval(function() {
                        var t = new Date().getTime();
                        if (t < e.activityRules.startTime) e.activityRules.status = "waiting", i = e.activityRules.startTime - t; else {
                            if (t > e.activityRules.endTime) return e.activityRules.status = "end", void clearInterval(n);
                            e.activityRules.status = "ing", i = e.activityRules.endTime - t;
                        }
                        e.activityRules.countDownTime = e.$tools.formatToHours(i / 1e3), i--, e.$emit("change", JSON.stringify(e.activityRules));
                    }, 1e3);
                }
            }
        };
        e.default = a;
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "pages/goods/detail/children/sh-price-create-component", {
    "pages/goods/detail/children/sh-price-create-component": function(t, e, i) {
        i("543d").createComponent(i("66a7"));
    }
}, [ [ "pages/goods/detail/children/sh-price-create-component" ] ] ]);